package com.fl.iocaop.java8;

import com.fl.iocaop.domain.Bean_List;
import com.fl.iocaop.domain.Dept;
import com.fl.iocaop.factory.UserFactory;
import org.junit.Test;

import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;

/*
    Lambda方法引用
    对象::实例方法名
    类::静态方法名
    类::实例方法名
 */
public class LambdaMethodRef {

    @Test
    public void test(){
        Consumer<String> con = System.out::println;
        con.accept("对象::实例方法名");
    }
    //类::静态方法名
    @Test
    public void test2(){
        Bean_List bean4 = UserFactory.TestBean4();
        Supplier<List<String>> sup =bean4::listget;
        sup.get().forEach(System.out::println);
    }

    //类::实例方法名
    @Test
    public void test3(){

    }
}
